package com.maya.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.maya.model.User;
import com.maya.service.UserService;



@Controller

public class ViewAllUsersController  {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("/viewallusers")
    public String viewalluser(Model model) {
        
    	List<User> users=userService.findAll();
    	 model.addAttribute("users", users);
         model.addAttribute("title", "所有用户");
         
         return "users";
        
    }

}
